home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11.lha / HBBS / Developer / Developer.Readme < prev    next >
Text File  |  1996-06-25  |  6KB  |  127 lines

  1. Yo, thanks for looking at this file..  To create any doors for HBBS
  2. you really should get hold of the full source code to it, when you have
  3. got that you'll be able to see loads of examples and figure out what does
  4. what better!
  5.  
  6.  
  7. But for now I'll give you a few instructions on how to create external
  8. programs (Doors) for HBBS.
  9. ==============================================================================
  10.  
  11.  
  12. To create a door all you have to do is this:
  13.  
  14. 1) go to wb, find HBBS:Source/Doors_User/!NewDoor
  15.  
  16. 2) select icon/copy from the menu to create a copy of the directory and
  17.    all the files that are in it..
  18.  
  19. 3) rename it to the name of your door
  20.  
  21. 3b) if your door is called NOT called by a user typing a command
  22.     at the BBS command prompt then it should go in Doors_System instead
  23.     (e.g. FrontEnd)
  24.  
  25. 4) open your new directory, in it you will see several files, the
  26.    important ones are:  Main.C, Build, !NukeObjects!, and Update.  Update and
  27.    !NukeObjects! are just amigados scripts to move files to
  28.    HBBS:Doors/[User|System]/<yourdoordir>/<yourdoorname>.HBBS and to
  29.    delete #?.o respectivly..
  30.  
  31. 5) load the file "Update" into a text editor and edit it so that
  32.    it copies the file called "Main", that the compiler produces, to the right
  33.    place.
  34.  
  35. 6) now you need to set your door up so that hbbs can run it, to do this you
  36.    need to edit a file in any Commands directory, there's one in each
  37.    conference, one in each node directory and one in HBBS:commands.  The file
  38.    you need to edit depends on a) what type of door it is and b) what the
  39.    minimum access level a user must have before thay can run it.   If it is a
  40.    system door then you'll need to edit the file called "System" in any
  41.    commands dir.  If it's a user door then you'll need to edit either
  42.    "Level_Global" (all users can use it no matter what their access level is)
  43.    or "Level_<acslevel>" where <acslevel> is the minimum access level a user
  44.    must have to run your door.
  45.  
  46.    E.G. "Level_50"
  47.  
  48.    Once you've decided which file you need to edit just load it up into a
  49.    text editor.
  50. 7) you now need to add a few lines to the file, these are as follows
  51.  
  52.   <Command>_Type_<num>=NORMAL
  53.   <Command>_Door_<num>=<door file>
  54.  
  55.   the following parameters are optional.
  56.  
  57.   <Command>_Debug_<num>=YES|NO
  58.   <Command>_Params_<num>=<some parameters for your door>
  59.  
  60.   here's an example for a joinconf door:
  61.  
  62.   J_Type_1=NORMAL
  63.   J_Door_1=HBBS:Doors/User/Download/Download.HBBS J_Debug_1=NO
  64.  
  65.   J_Type_2=NORMAL
  66.   J_Door_2=HBBS:Doors/User/Stats/Stats.HBBS J_Params_2=JOINEDCONF
  67.  
  68.   <num> (above) means the order in which the doors are run, you can run as many
  69.   doors one after the other as you like, if your door fails and another
  70.   following door relies on your door's output then just call
  71.   DOOR_Continue(FALSE); and the following doors will not get run (see the
  72.   download door's source for an example..
  73.  
  74.   the <params> are passed to your door as N_ND->CurrentDoor->SystemOptions,
  75.   it's just a string so you can just parse it as you would a normal string.
  76.  
  77. 8) thats it!..  it sounds complicated but it really is incredibly
  78.    easy and simple..
  79.  
  80.   Note: if you want to use a source code debugger on your door then you can set
  81.   <command>_Debug_<num> to YES or TRUE (or ON :-) and when the door is called,
  82.   a window will open on the control screen's window telling you what parameters
  83.   to run your program with..   so if you are using CPR (line debugger with SAS/C)
  84.   then call your door as CPR <door> <nodenum> <params> and bob's your uncle..  a
  85.   bit easier than /x :-)
  86.  
  87.  
  88. Here's couple more tips to get you going..
  89.  
  90. when you write strings to the bbs you can use either DOOR_SysopText(string) or
  91. DOOR_WriteText(string), you *MUST* use CR+LF ("\r\n") at the end of a line. not
  92. just "\n", (this is due to comms packages and the console.device... and it's
  93. not just HBBS that needs this..   Use DOOR_SysopText(string) to display stuff
  94. on the sysop's watch window ONLY, or use DOOR_WriteText(string) to write stuff
  95. to the serial port *AND* the sysop's watch window.
  96.  
  97. check out DOOR_GetLine(), this is the main thing you use to get input from the
  98. user, at the moment the user cannot use thier cursor keys for anything other
  99. than line editing or scrolling through thier command history,  so (for example)
  100. you can't use cursor up to scroll back when you are looking through the
  101. filelists.   This will change soon, I'll just add another flag value that
  102. you'll be able to specify (something like GL_RAWKEY)..
  103.  
  104. to read a line of text, with history, and timeout after 20 secs, max len 80
  105. chars and a prompt string of "Banana" do this:
  106.  
  107. DOOR_GetLine(GL_DISPLAY|GL_EDIT|GL_HISTORY,'\0',80,20,"Banana");
  108.  
  109. getline returns different numbers depending on what happened, check out
  110. HBBS:Source/Common/Defines.h and search for IN_#?
  111.  
  112. e.g.  a timeout returns IN_TIMEOUT, a normal line would be IN_GOTLINE, or
  113. IN_LOSSCARRIER.
  114.  
  115. after EVERY call to DOOR_GetLine() you *MUST*, and I mean *MUST*, check the
  116. status of N_ND->OnlineStatus, if it is not equal to OS_ONLINE then your door
  117. must exit *without* sending *ANY* more data to the serial port..
  118.  
  119. then, if the user is still on-line, the string returned will be placed in
  120. N_ND->CurrentLine which is a pointer to a null terminated string.
  121.  
  122.  
  123. Also check out HBBS_LoadConfig(), HBBS_CreateConfig(), HBBS_GetSetting(),
  124. HBBS_AddCfgItem(), HBBS_RemoveCfgItem(), HBBS_SaveConfig(), and
  125. HBBS_FlushConfig() for some COOOOOL standard configuration file loading
  126. and saving routines, check out Node_Main.C for some examples....
  127.